import Koa from 'koa'

class ErrorHandler{
  private app: Koa
  constructor(app:Koa){
    this.app = app
    this.handler()
  }
  handler(){
    this.app.on('error',(err,ctx) => {
      console.error('server error', err, ctx)
    })
  }
}

export default ErrorHandler
